#ifndef _UNIVERSAL_H_

#define _UNIVERSAL_H_

#include "SDL2/SDL.h"

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>

#include <math.h>

// 默认窗口宽度
#define WINDOW_WIDTH (800)
// 默认窗口高度
#define WINDOW_HEIGHT (600)

// 数据默认初始化(0)
#define DATA_INIT (0)

#define CHAR_SIZE (sizeof(char))
#define INT_SIZE (sizeof(int))
#define FLOAT_SIZE (sizeof(float))

#define newCharP(size) ((char*)malloc(CHAR_SIZE*(size)))
#define newIntP(size) ((int*)malloc(INT_SIZE*(size)))
#define newFloatP(size) ((float*)malloc(FLOAT_SIZE*(size)))

typedef struct _MyWindow {
    bool isValid;
    bool isInited;
    bool shouldClose;
    unsigned int width;
    unsigned int height;
    SDL_Window *window;
    SDL_Renderer **renders;
    unsigned int renderNum;

} MyWindow;

#define MY_WINDOW_SIZE (sizeof(float))
#define newMyWinP(size) ((MyWindow*)malloc((MY_WINDOW_SIZE)*size))

#endif